import 'package:flutter/material.dart';

class PersonAnnualProjectPage extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => _PersonAnnualProjectState();
}

class _PersonAnnualProjectState extends State<PersonAnnualProjectPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Container(
        padding: EdgeInsets.all(20),
       /* child: Column(
          children: [
            Row(
              children: [
                TitleAndInput(
                  title: '医疗机构名称',
                  hint: '请输入',
                ),
                SizedBox(
                  width: 30,
                ),
                Text('年份', style: TextStyle(fontSize: 12)),
                SizedBox(width: 10),
                Container(
                  height: height(40),
                  width: width(250),
                  decoration: inputBorderBg(),
                  padding: EdgeInsets.only(left: 10, right: 5),
                  alignment: Alignment.centerRight,
                  child: Icon(
                    Icons.date_range,
                    size: 15,
                    color: Color(0xffBFBFBF),
                  ),
                ),
                _searchBtn(),
              ],
            ),
            Expanded(
              child: ListView.builder(
                padding: EdgeInsets.only(top: 0),
                itemBuilder: (context, index) => _buildListViewItem(index),
                itemCount: 10,
              ),
            ),
          ],*/
        // ),
      ),
    );
  }

  ///搜索按钮
  Widget _searchBtn() {
    return Container(
      // color: Color(u_2787de),
      margin: EdgeInsets.only(left: 10),
      width: 50,
      height: 25,
      child: OutlineButton(
        padding: EdgeInsets.all(0),
        child: Text(
          '搜索',
          textAlign: TextAlign.center,
          style: TextStyle(
              color: Colors.white, fontSize: 12),
        ),
        onPressed: () {},
      ),
    );
  }

  Widget _buildListViewItem(int index) {
    return Container(
      margin: EdgeInsets.only(top: 20),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          Text(
            '广安市人民医院',
            style: TextStyle(
              fontSize: 12,
              fontWeight: FontWeight.w400,
            ),
          ),
          _buildListViewItemHeader(),
          _buildListViewItemContent(index),
          // dividerH(hex: u_b1c8e1)
        ],
      ),
    );
  }

  ///item的头部标题
  Widget _buildListViewItemHeader() {
    return Container(
      margin: EdgeInsets.only(top: 5),
    /*  color: Color(u_bbd4ee),
      height: 25,
      child: Row(
        children: [
          dividerVertical(),
          Expanded(
            flex: 1,
            child: Text(
              '序号',
              style: TextStyle(fontSize: isLargeScreen ? 12 : 10),
              textAlign: TextAlign.center,
            ),
          ),
          dividerVertical(),
          Expanded(
            flex: 4,
            child: Text(
              '诊疗项目',
              style: TextStyle(fontSize: isLargeScreen ? 12 : 10),
              textAlign: TextAlign.center,
            ),
          ),
          dividerVertical(),
          Expanded(
            flex: 2,
            child: Text(
              '金额',
              style: TextStyle(fontSize: isLargeScreen ? 12 : 10),
              textAlign: TextAlign.center,
            ),
          ),
          dividerVertical(),
          Expanded(
            flex: 2,
            child: Text(
              '数量',
              style: TextStyle(fontSize: isLargeScreen ? 12 : 10),
              textAlign: TextAlign.center,
            ),
          ),
          dividerVertical(),
        ],
      ),*/
    );
  }

  Widget _buildListViewItemContent(int index) {
    return Container(
      height: 25,
    /*  child: Row(
        children: [
          dividerVertical(),
          Expanded(
            flex: 1,
            child: Text(
              '${index + 1}',
              style: TextStyle(fontSize: isLargeScreen ? 12 : 10),
              textAlign: TextAlign.center,
            ),
          ),
          dividerVertical(),
          Expanded(
            flex: 4,
            child: Text(
              '药品',
              style: TextStyle(fontSize: isLargeScreen ? 12 : 10),
              textAlign: TextAlign.center,
            ),
          ),
          dividerVertical(),
          Expanded(
            flex: 2,
            child: Text(
              '3899',
              style: TextStyle(fontSize: isLargeScreen ? 12 : 10),
              textAlign: TextAlign.center,
            ),
          ),
          dividerVertical(),
          Expanded(
            flex: 2,
            child: Text(
              '102',
              style: TextStyle(fontSize: isLargeScreen ? 12 : 10),
              textAlign: TextAlign.center,
            ),
          ),
          dividerVertical(),
        ],
      ),*/
    );
  }
}
